package com.androidgame.fx;

public class ScreenConfig {
	
	public static int screenWidth;
	public static int screenHeight; 
	public static int virtualScreenWidth;
	public static int virtualScreenHeight;
	
	public ScreenConfig(int screenWidth , int screenHeight, int virtualWidth, int virtualHeight){
		ScreenConfig.screenWidth 	= screenWidth;
		ScreenConfig.screenHeight 	= screenHeight;
		ScreenConfig.virtualScreenWidth = virtualWidth; 
		ScreenConfig.virtualScreenHeight = virtualHeight;	
	}
	
	public void setSize(int width, int height){
		ScreenConfig.virtualScreenWidth = width;
		ScreenConfig.virtualScreenHeight = height;
	}
	
	public int getX(int x){
		return (int)( x * screenWidth/virtualScreenWidth);
	}
	
	public int getY(int y){
		return (int)( y * screenHeight/virtualScreenHeight);
	}
	
	public void setConfig(int screenWidth , int screenHeight, int virtualWidth, int virtualHeight) {
		ScreenConfig.screenWidth 	= screenWidth;
		ScreenConfig.screenHeight 	= screenHeight;
		ScreenConfig.virtualScreenWidth = virtualWidth;
		ScreenConfig.virtualScreenHeight = virtualHeight;
	}
	
}	
	